<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let obj = {a: 10, b: 20}
    // 需求: 将所有的键收集到一个数组中
   /*  let arr = []
    for(let k in obj) {
      arr.push(k)
    }
    console.log(arr); */
    // Object.keys  对象的键们
   console.log(Object.keys(obj)); // ['a', 'b']
   console.log(Object.values(obj)); // [10, 20]
  </script>
</body>
</html>